package model.<%%# m.Caption #%%>;

import org.hoyi.DB.comment.DbAttrANNO;
import org.hoyi.DB.comment.EntityAttrANNO;
import org.hoyi.DB.comment.datatype;
import org.hoyi.DB.ctrl.HOYI;
import org.hoyi.DB.ctrl.HOYICMD;
import org.hoyi.DB.ents.Entity;
import org.hoyi.DB.model.AttField;


/**
*  实体类 <%%# e.ClassName #%%> 属性说明自动提取数据库字段的描述信息.
*/
@EntityAttrANNO(tablename="<%%# e.ClassName #%%>", comment="<%%# e.EntityName #%%>")
public class <%%# e.ClassName #%%> extends Entity{
	//#region 静态字段
	<%%# [Fields[x]={/// <summary>
	/// <%#= t.Comment #%>
	/// </summary>
	public static AttField <%#= t.ColumnName #%> = new AttField("<%#= t.ColumnName #%>");
	}] #%%>   
	//#endregion 静态字段
	
	
	//#region 字段
	<%%# [Fields[x]={/// <summary>
	/// <%#= t.Comment #%>
	/// </summary>	
	<%#= t.dbjavaattr() #%>
	public String _<%#= t.ColumnName #%> ;

	}] #%%> 
	
	
	<%%# [Fields[x]={/// <summary>
	/// <%#= t.Comment #%>
	/// </summary>	
	
	public String get<%#= t.ColumnName.ToParscal() #%>(){
		if(this._<%#= t.ColumnName #%> == null)
			return "";
		return this._<%#= t.ColumnName #%>;
	}
	
	public void set<%#= t.ColumnName.ToParscal() #%>(String F_<%#= t.ColumnName.ToCamel() #%>)
	{
		this._<%#= t.ColumnName #%> = F_<%#= t.ColumnName.ToCamel() #%>;
		
	}
	}] #%%> 
	//#endregion 字段
	
				
	public static <%%# e.ClassName #%%> NEW(){
		return new <%%# e.ClassName #%%>();
	} 
	<%%#!-- 这里是无参和带参构造方法 #%%>
	public <%%# e.ClassName #%%>() {
	}
	
	public <%%# e.ClassName #%%>(<%%# [Fields[Inner,1,Last(1)]={ String F_<%#= t.ColumnName #%> , }] #%%><%%# [Fields[Last,1]={ String F_<%#= t.ColumnName #%> }] #%%>){
		<%%# [Fields[Fields[Inner,1,Last(0)]={ this._<%#= t.ColumnName #%> =  F_<%#= t.ColumnName #%>;
		}] #%%>
	}	
	
	public <%%# e.ClassName #%%>(<%%# [Fields[Inner,0,Last(1)]={ String F_<%#= t.ColumnName #%> , }] #%%><%%# [Fields[Last,1]={ String F_<%#= t.ColumnName #%> }] #%%>){
		<%%# [Fields[Fields[Inner,0,Last(0)]={ this._<%#= t.ColumnName #%> =  F_<%#= t.ColumnName #%>;
		}] #%%>
	}	
	
	//#region 语法所迫, 初始化命令.
	
	public static HOYICMD E() {
			return HOYI.E(<%%# e.ClassName #%%>.class);
	}
	
	@Override
	public String getFirstfield() {
		// TODO Auto-generated method stub
		return "<%%# t.getfirfieldname() #%%>";
	}
	
	@Override
	public String getSecondfield() {
		// TODO Auto-generated method stub
		return "<%%# t.getsecfieldname() #%%>";
	}

	//#endregion 语法所迫, 初始化命令.
}
